package com.sky.enums;

import io.swagger.models.auth.In;
import lombok.*;

/**
 * PROJECT_NAME: sky-take-out
 * NAME: Jobenum
 *
 * @AUTHOR: zhang
 * DATE: 2024/1/28
 * DESCRIPTION :
 */

@Getter
@AllArgsConstructor
public enum Jobenum {
    /**
     * 学生枚举
     */
     STUDENT(0,"学生"),
    /**
     * 老师枚举
     */
     TEACHER(1,"老师"),
    ;


    private final Integer code;
    private final String  msg;


    public static Integer getCode(Integer code) {
        for (Jobenum value : Jobenum.values()) {
            if (value.code.equals(code)){
                return value.code;
            }
        }
        return null;
    }


    public static String getMSG(String msg) {
        for (Jobenum value : Jobenum.values()) {
            if (value.msg.equals(msg)){
                return value.msg;
            }
        }
        return null;
    }


    public static void main(String[] args) {
        Integer code = Jobenum.getCode(1);
        System.out.println(code);

        String msg = Jobenum.getMSG("学生");
        System.out.println(msg);

        Integer code1 = Jobenum.STUDENT.code;
        System.out.println(code1);
    }

}
